<?php

/**
 * SeguridadHigiene form base class.
 *
 * @method SeguridadHigiene getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseSeguridadHigieneForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'nro'                => new sfWidgetFormInputText(),
      'mbk'                => new sfWidgetFormInputText(),
      'piso'               => new sfWidgetFormInputText(),
      'dpto'               => new sfWidgetFormInputText(),
      'nro_inscripcion'    => new sfWidgetFormInputText(),
      'razon_social'       => new sfWidgetFormInputText(),
      'superficie'         => new sfWidgetFormInputText(),
      'fecha_habilitacion' => new sfWidgetFormDate(),
      'calle_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Calle'), 'add_empty' => false)),
      'barrio_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Barrio'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'nro'                => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'mbk'                => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'piso'               => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'dpto'               => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'nro_inscripcion'    => new sfValidatorString(array('max_length' => 18, 'required' => false)),
      'razon_social'       => new sfValidatorString(array('max_length' => 60)),
      'superficie'         => new sfValidatorNumber(),
      'fecha_habilitacion' => new sfValidatorDate(),
      'calle_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Calle'))),
      'barrio_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Barrio'))),
    ));

    $this->widgetSchema->setNameFormat('seguridad_higiene[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'SeguridadHigiene';
  }

}
